package com.test;

/**
 * Created by chopin on 2017/11/13.
 */
public class MyThread extends Thread{

    public MyThread(String name){
        super(name);
    }

    public void run(){
        System.out.println("MyThread , " + getName() + " 线程运行开始!");
        while(true){
            for (int i = 0; i < 10; i++) {
                System.out.println(i + " " + getName());
                try {
                    sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            //System.out.println("MyThread , " + getName() + " 线程运行结束!");
        }

    }

}
